<template>
	<view class="page-box">
		<view class="content">
			<u-swiper :list="list1" @change="change" @click="click" autoplay height="400rpx"></u-swiper>
		</view>

		<view class="content">
			<view class="menu-box">
				<text class="menu-title">工具菜单</text>
				<text class="menu-more">更多</text>
			</view>
			<u-grid @click="click" col="4">
				<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" @click="goPage(baseListItem)">
					<u--image :src="baseListItem.url" shape="circle" width="100rpx" height="100rpx"></u--image>
					<text class="grid-text">{{baseListItem.title}}</text>
				</u-grid-item>
			</u-grid>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				list1: [
					"https://img2.baidu.com/it/u=375582900,4198359404&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500",
					"https://img2.baidu.com/it/u=2130747858,3032436019&fm=253&fmt=auto&app=138&f=JPEG?w=715&h=500",
				],
				baseList: [{
						url: 'https://img1.baidu.com/it/u=764211890,101798367&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
						title: '图片切割',
						path:'/pages/photo-split/photo-split'
					},
					{
						url: 'https://img0.baidu.com/it/u=2696975701,568789893&fm=253&fmt=auto&app=138&f=JPEG?w=295&h=300',
						title: '图片尺寸'
					},
					{
						url: 'https://img0.baidu.com/it/u=1006504670,3132400937&fm=253&fmt=auto&app=138&f=JPEG?w=300&h=300',
						title: '图片清晰'
					},
					{
						url: 'https://img2.baidu.com/it/u=3189548177,3143992533&fm=253&fmt=auto&app=138&f=JPEG?w=539&h=500',
						title: '图片合并'
					},
					{
						url: 'https://img2.baidu.com/it/u=3050577274,1372690568&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
						title: 'AI出图'
					},
					{
						url: 'https://img1.baidu.com/it/u=195845752,3863414435&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
						title: '去除水印'
					},
					{
						url: 'https://img1.baidu.com/it/u=2011726292,163774685&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
						title: '添加水印'
					}
				]
			}
		},
		mounted() {},
		onLoad() {

		},
		methods: {
			goPage(item){
				if(item.path){
					uni.navigateTo({
						url:item.path
					})
				}else{
					uni.showToast({
						icon:'error',
						title:'即将开放'
					})
				}

			}
		}
	}
</script>

<style lang="scss">
	.page-box{
		background-color:#f8f8f8;
		height: 100vh;
	}
	.content {
	
		background-color: white;
		margin: 0rpx 20rpx 20rpx 20rpx;
		border-radius: 10rpx;
	}
	
	.menu-box{
		font-size:30rpx;
		font-weight: bold;
	padding:10rpx;
		display: flex;
		justify-content: space-between;
	}
	.menu-title{
			
		font-weight: normal;
	}
	.menu-more{
		font-weight: normal;
		font-size: 25rpx;
	}

	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 10rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}
</style>
